public class Demo15 {
    private static int i=0;
    public static void main(String[] args) throws InterruptedException {
        for (; i < 20; i++) {
            Thread t=new Thread(()->{
                System.out.println(i);
            });
            t.start();
            t.join();
        }
        System.out.println("ok");
    }
}
